<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>百度ECHarts</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/layui.css" rel="stylesheet">
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">
    <link rel="stylesheet" href="/js/layui-v2.6.6/layui/css/layui.css">

</head>
<style>
    .red{font-weight: bold;color: #FF5722}
    #info{
        background: #fff;
        margin-bottom: 16px;
    }
    .create{
        border: 1px solid #ccc;
        border-radius: 5px;
        overflow: hidden;
        padding: 10px;
        box-sizing: border-box;
    }
    .create .game{
        width: 60px;
        height: 60px;
        float: left;
        margin-right: 15px;
    }

    .create .game img{
        width: 100%;
        vertical-align: middle;
    }

    .create .createDesc{
        float: left;
    }

    .top-title{
        margin:16px 24px 24px 24px;
    }
    .dashboard-header{
        padding: 12px 16px;
        color: #333;
        border-radius: 4px;
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
        -ms-border-radius: 4px;
    }
    .col-sm-12{
        padding: 0;
    }
    .wrapper{
        margin:0 24px 16px 24px;
        padding: 0 16px;
    }
    .row-type{
        background: none !important;
    }
    @media (min-width: 768px){
        .col-sm-2 {
            width: 32.33333%;
        }
    }
    .col-sm-2 {
        padding: 0;
    }
    .create{
        border: none;
        padding: 14px 24px 14px 32px;
        border-radius: 4px;
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
        -ms-border-radius: 4px;
    }
    .tables{
        clear: both;
    }
    .creatType1{
        background: linear-gradient(314deg, #fff 0%, #F9FFFA 100%);
        box-shadow: 0px 3px 6px 1px rgba(181,197,223,0.1);
        margin-right: 1.5%;
    }
    .creatType2{
        background: linear-gradient(314deg, #fff 0%, #F9FCFF 100%);
        box-shadow: 0px 3px 6px 1px rgba(181,197,223,0.1);
        margin-right: 1.5%;
    }
    .creatType3{
        background: linear-gradient(314deg, #fff 0%, #FFF9F9 100%);
        box-shadow: 0px 3px 6px 1px rgba(181,197,223,0.1);
    }
    .create .game{
        width: 300px;
        height: auto;
        float: right;
        margin-right: 2%;
    }
    .create .game img{
        width: 300px;
        height: 136px;
    }
    .createDesc .title{
        color: #2F364A;
        font-size: 18px;
        font-weight: bold;
        margin-bottom: 24px;
    }
    .createDesc .tips{
       font-size: 14px;
       color: #676E82;
       margin-bottom: 24px;
    }
    .gray-bg .row{
        box-shadow: 0px 2px 3px 1px rgba(181,197,223,0.1);
        -moz-box-shadow: 0px 2px 3px 1px rgba(181,197,223,0.1);
        -webkit-box-shadow: 0px 2px 3px 1px rgba(181,197,223,0.1);
        -ms-box-shadow: 0px 2px 3px 1px rgba(181,197,223,0.1);
        border-radius: 2px 2px 2px 2px;
        -moz-border-radius: 2px 2px 2px 2px;
        -webkit-border-radius: 2px 2px 2px 2px;
        -ms-border-radius: 2px 2px 2px 2px;
        background: #fff;

    }
    .ibox{
        margin-bottom: 0;
    }
    .ibox .ibox-title{
        border-top: 0;
        padding: 14px 0 14px 17px;
        background: none;
        position: relative;
        font-size: 16px;
        color: #2F364A;
        font-weight: bold;
    }
    .ibox .ibox-title:after{
        content: '';
        width: 4px;
        height: 16px;
        background: #5AAEDF;
        position: absolute;
        left: 0;
        top: 16px;
    }
    .ibox .layui-table-view{
        margin: 0;
    }
    .layui-table tbody tr:hover, .layui-table thead tr, .layui-table-click, .layui-table-header, .layui-table-hover, .layui-table-mend, .layui-table-patch, .layui-table-tool, .layui-table-total, .layui-table-total tr, .layui-table[lay-even] tr:nth-child(even) {
        background-color: #F8FAFF;
        color: #06172A;
        font-size: 16px;
    }
    .layui-table-view .layui-table td, .layui-table-view .layui-table th {
        padding: 9px 0;
    }
    .layui-table th, .layui-table td, .layui-table[lay-skin="line"], .layui-table[lay-skin="row"], .layui-table-view, .layui-table-header, .layui-table-tool {
       border: none;
    }
    .layui-table-header{
        background-color: #F8FAFF;
        color: #06172A;
        font-size: 16px;
        border-bottom: 1px solid #DFEAF1;
        border-top: 1px solid #DFEAF1;
    }
    .layui-table-cell {
        padding: 0 24px;
    }
    .layui-table{
        color: #676E82;
        font-size: 14px;
    }
    .layui-table-tips-c:before {
        position: relative;
        right: 1px;
        top: -4px;
    }
    .layui-table-body{
        margin-bottom: 0px;
    }
    .layui-table tr{
        border-bottom: 1px solid #DFEAF1;

    }
    .col-sm-12{
        box-shadow: none;
    }
</style>
<body class="gray-bg">

<div class="row top-title white-bg dashboard-header">
    <div class="col-sm-12">
        <p>
            <img src="/img/homeIcon.png" width="16" height="16" style="margin-right: 12px;margin-bottom: 4px">
            欢迎 <span th:text="${name}" style="font-size: 16px"></span>
<!--            ，你的所属机构为<span th:text="${orgName}" style="font-size: 16px"></span>-->
            ，你的角色为 <span th:text="${roleNames}" id="roleNames" style="font-size: 16px"></span>
        </p>
    </div>
</div>

<div class="wrapper animated fadeInRight">
    <div class="row row-type" id="info">
        <!---->
    </div>

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    正在进行的竞赛
<!--                    <div class="ibox-tools">-->
<!--                        <a class="collapse-link">-->
<!--                            <i class="fa fa-chevron-up"></i>-->
<!--                        </a>-->
<!--                        &lt;!&ndash;<a class="dropdown-toggle" data-toggle="dropdown" href="graph_flot.html#">&ndash;&gt;-->
<!--                        &lt;!&ndash;<i class="fa fa-wrench"></i>&ndash;&gt;-->
<!--                        &lt;!&ndash;</a>&ndash;&gt;-->
<!--                        &lt;!&ndash;<a class="close-link">&ndash;&gt;-->
<!--                        &lt;!&ndash;<i class="fa fa-times"></i>&ndash;&gt;-->
<!--                        &lt;!&ndash;</a>&ndash;&gt;-->
<!--                    </div>-->
                </div>


                <table id="templet"></table>

<!--                <div class="ibox-content">-->
<!--                    <div class="layui-form">-->

<!--                        <table class="layui-table" id="t1">-->
<!--                            <thead>-->
<!--                            <tr class="layui-bg-green">-->
<!--                                <th>竞赛名称</th>-->
<!--                                <th>竞赛时间</th>-->
<!--                                <th>竞赛方式</th>-->
<!--                                <th>竞赛总人数</th>-->
<!--                            </tr>-->
<!--                            </thead>-->
<!--                            <tbody th:if="${stuNoReview ==0 && expNoReview ==0 && orgNoReview ==0}">-->
<!--                            <tr> <td colspan="4">暂无任务</td></tr>-->
<!--                            </tbody>-->
<!--                            <tbody  th:else>-->
<!--                            <tr th:if="${stuNoReview !=0}">-->
<!--                                <td>考生报名信息</td>-->
<!--                                <td th:text="${stuAllNum}"></td>-->
<!--                                <td class="red" th:text="${stuNoReview}"></td>-->
<!--                                <td><a class="J_menuItem" href="/jzweb/stuSignUp">去处理</a></td>-->
<!--                            </tr>-->
<!--                            <tr th:if="${expNoReview !=0}">-->
<!--                                <td>专家信息</td>-->
<!--                                <td th:text="${orgAllNum}"></td>-->
<!--                                <td class="red" th:text="${expNoReview}"></td>-->
<!--                                <td><a class="J_menuItem" href="/jzweb/experts">去处理</a></td>-->
<!--                            </tr>-->
<!--                            <tr th:if="${orgNoReview !=0}">-->
<!--                                <td>机构信息</td>-->
<!--                                <td th:text="${expAllNum}"></td>-->
<!--                                <td class="red" th:text="${orgNoReview}"></td>-->
<!--                                <td><a class="J_menuItem" href="/jzweb/organizationRoles">去处理</a></td>-->
<!--                            </tr>-->
<!--                            <tr  th:if="${eroomNoReview !=0}">-->
<!--                                <td>考场信息</td>-->
<!--                                <td th:text="${eroomAllNum}"></td>-->
<!--                                <td class="red" th:text="${eroomNoReview}"></td>-->
<!--                                <td><a class="J_menuItem" href="/jzweb/examinationRoom">去处理</a></td>-->
<!--                            </tr>-->
<!--                            <tr>-->
<!--                            </tbody>-->
<!--                        </table>-->
<!--                        <table class="layui-table" id="t2">-->
<!--                            <thead>-->
<!--                            <tr class="layui-bg-green">-->
<!--                                <th>任务名称</th>-->
<!--                                <th>总数</th>-->
<!--                                <th>操作</th>-->
<!--                            </tr>-->
<!--                            </thead>-->
<!--                            <tbody>-->
<!--                            <tr th:if="${stuNoReview !=0}">-->
<!--                                <td>考生报名信息</td>-->
<!--                                <td th:text="${stuAllNum}"></td>-->
<!--                                <td><a class="J_menuItem" href="/jzweb/stuSignUp">去处理</a></td>-->
<!--                            </tr>-->
<!--                            <tr>-->
<!--                                <td>考场</td>-->
<!--                                <td th:text="${eroomAllNum}"></td>-->
<!--                                <td><a class="J_menuItem" href="/jzweb/examinationRoom">去处理</a></td>-->
<!--                            </tr>-->
<!--                            </tbody>-->
<!--                        </table>-->
<!--                        <table class="layui-table" id="t3">-->
<!--                            <tr>-->
<!--                                <td>暂无任务</td>-->
<!--                            </tr>-->
<!--                        </table>-->
<!--&lt;!&ndash;                        <table class="layui-table" id="t4">&ndash;&gt;-->
<!--&lt;!&ndash;                            <tr>&ndash;&gt;-->
<!--&lt;!&ndash;                                <td><a class="J_menuItem" style="text-decoration:underline" href="/jzweb/recruitmentNews">发布招聘信息</a></td>&ndash;&gt;-->
<!--&lt;!&ndash;                            </tr>&ndash;&gt;-->
<!--&lt;!&ndash;                        </table>&ndash;&gt;-->
<!--                    </div>-->
<!--                </div>-->

            </div>
        </div>
    </div>

</div>
<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/layui/layui.js?v=3.3.6"></script>

<!-- 自定义js -->
<script src="/js/content.js?v=1.0.0"></script>
<!--<script type="text/javascript" src="/js/contabs.js"></script>-->
<script>
    var roleNames =$("#roleNames").text();
    if(roleNames.indexOf("超级用户角色") > -1){
        $("#t1").show();
        $("#t2").hide();
        $("#t3").hide();
    }else if(roleNames.indexOf("考核站点") > -1){
        $("#t1").hide();
        $("#t2").show();
        $("#t3").hide();
    }else{
        $("#t1").hide();
        $("#t2").hide();
        $("#t3").show();
    }

    $(function () {
        $.ajax({
            url:'/earning',
            type:'POST',
            success:function (r) {

                if (r.code == 0){
                    var info =
                        '<div class="col-sm-2 creatType1" >' +
                        '            <div class="create"> ' +
                            '           <a class="tables" href="/jzweb/examinationBatch?type=3">'+
                            '                <div class="createDesc">' +
                            '                      <p class="title">创建竞赛</p>  ' +
                            '                      <p class="tips">快速创建并发布竞赛</p>  ' +
                            '                      <img src="./img/navArrow1.png" width="24" height="24"  alt="">  ' +
                            '                </div>' +
                            '                <div class="game">' +
                            '                     <img src="./img/navBg1.png" alt="">' +
                            '                </div>' +
                            '            </a>' +
                        '           </div>' +
                        '        </div>' +
                        '<div class="col-sm-2 creatType2" >' +
                        '            <div class="create"> ' +
                        '           <a class="tables" href="/jzweb/itemBank">'+
                        '                <div class="createDesc">' +
                        '                      <p class="title">试题导入</p>  ' +
                        '                      <p class="tips">快速创建并发布竞赛</p>  ' +
                        '                      <img src="./img/navArrow2.png" width="24" height="24"  alt="">  ' +
                        '                </div>' +
                        '                <div class="game">' +
                        '                     <img src="./img/navBg2.png" alt="">' +
                        '                </div>' +
                        '            </a>' +
                        '           </div>' +
                        '        </div>' +
                        '<div class="col-sm-2 creatType3" >' +
                        '            <div class="create"> ' +
                        '           <a class="tables" href="/jzweb/stuSignUpCom?types=3">'+
                        '                <div class="createDesc">' +
                        '                      <p class="title">选手管理</p>  ' +
                        '                      <p class="tips">选手信息统一管理</p>  ' +
                        '                      <img src="./img/navArrow3.png" width="24" height="24"  alt="">  ' +
                        '                </div>' +
                        '                <div class="game">' +
                        '                     <img src="./img/navBg3.png" alt="">' +
                        '                </div>' +
                        '            </a>' +
                        '           </div>' +
                        '        </div>'
                    $('#info').html(info);
                }
            }
        })


        layui.use('table', function(){
            var table = layui.table;

            //第一个实例
            table.render({
                elem: '#templet'
                ,url: '/jzApi/examinations/selExaminationComAll' //数据接口
                ,method:'post'
                ,contentType: 'application/json'
                ,where:{
                    competitionType: sessionStorage.getItem('competitionTypes') == 'null' ? null : sessionStorage.getItem('competitionTypes'),
                    userId: sessionStorage.getItem('refereeId') == 'null' ? null : sessionStorage.getItem('refereeId')
                }
                ,cols: [[ //表头
                    {field: 'name', title: '竞赛名称',width:500}
                    ,{field: 'startTime', title: '竞赛时间',width:500,templet:function (d){
                            if( d ){
                                return d.startTime +' ~ '+ d.endTime;
                            }
                        }
                    }
                    ,{field: 'type', title: '竞赛方式',width:322, templet:function (d){
                            if(d){
                                return '<span>'+ d.type +'</span>'
                            }
                        }
                    }
                    ,{field: 'num', title: '竞赛总人数',width:322, }
                ]]
            });

        });

    })

</script>
</body>

</html>
